package com.sdp.right.excel.style;

import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.style.column.AbstractColumnWidthStyleStrategy;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet;
import java.util.List;

public class ExcelWidthStyleStrategy extends AbstractColumnWidthStyleStrategy {

	@Override
	protected void setColumnWidth(WriteSheetHolder writeSheetHolder, @SuppressWarnings("rawtypes") List<CellData> cellDataList, Cell cell, Head head,
			Integer relativeRowIndex, Boolean isHead) {

		Sheet sheet = writeSheetHolder.getSheet();
		sheet.setColumnWidth(cell.getColumnIndex(), 3000);

	}

}
